<?php

include_once('./common.php');
include_once(S_ROOT.'./source/function_admin.php');
include_once(S_ROOT.'./source/function_ui.php');
if (!defined('IN_ADMIN')) {
    exit('Access Denied');
}


if ($_GET['action'] == "doTask"){
    $uid    = intval($_GET ['uid']);
    $task   = strval($_GET ['task']);
    
    // 匹配规则
    $rules = array(
            'user:invite'             =>    'invite',
            'user:share'              =>    'share',
            'user:topic:elite'        =>    'topic_elite',
            'user:freshman:reward'    =>    'freshman_reward',
            'user:perfect:information' =>    'perfect_information',
            'user:write'              =>    'daily_write_reward',
            'user:ability:award'      =>    'ability_monthly_award'
    );
    
    $task = $rules[$task];
    
    if ($uid < 1 || empty($task) ){
        return FALSE;
    }

    $param = array(
            'do'    => 'doTask',
            'format'=> 'json',
            'uid'   =>  $uid,
            'task'  =>  $task,
    );
    $content = doTask($param);
}
echo $content;
// 做任务
function doTask($param){
	$content = get_api_content($_SC ['apiurl'], $param, "1ee4735dfd4ab146c55e684d63e0b82a" , 5687598 );
    return $content;
}







